package grape.base.rest.client.role;

import grape.base.service.role.po.Role;
import grape.base.service.user.po.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by yangwei
 * Created at 2020/6/9 14:32
 */
@Component
@FeignClient(value = "grape-base")
public interface RoleClient {


    /**
     * 根据角色id查询角色
     * @param roleId
     * @return
     */
    @GetMapping(value = "/role/inner/getRoleByRoleId")
    public Role getByRoleId(@RequestParam String roleId);

    /**
     * 根据角色id查询角色
     * @param roleIds
     * @return
     */
    @GetMapping(value = "/role/inner/getRoleByRoleIds")
    public List<Role> getByRoleIds(@RequestParam List<String> roleIds);

    /**
     * 根据用户id查询角色
     * @param userId
     * @return
     */
    @GetMapping(value = "/role/inner/getRoleByUserId")
    public List<Role> getByUserId(@RequestParam String userId);

}
